import React from "react";

class TodoItem extends React.Component {
    constructor() {
        super();

        this.handleDelete = this.handleDelete.bind(this);
    }

    handleDelete() {
        this.props.delete(this.props.index);
    }

    render() {
        return (
            <li className="item" onClick={ this.handleDelete }>{this.props.data}</li>
        );
    }
}

export default TodoItem;
